<html>
<head><meta charset="utf-8"><title>Slow compile times. 14s in wf_checking for ~6000 loc? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html">Slow compile times. 14s in wf_checking for ~6000 loc?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206310932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206310932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206310932">(Aug 07 2020 at 21:20)</a>:</h4>
<p>Hey all. I was going to open an issue but I figured I'd ask here first. The crate <code>glow</code> (<a href="https://github.com/grovesNL/glow">https://github.com/grovesNL/glow</a>)  isn't very complicated (it's a bunch of extern functions and ~2200 lines of functions mostly just wrapping the externs), but for some reason it's spending a bunch of time in "wf_checking" as reported by <code>-Z time-passes</code>.  13.176 seconds in <code>wf_checking</code>  14.858 seconds total.</p>
<p>Is this issue worthy? Anyone know what's up here?</p>



<a name="206311516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206311516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206311516">(Aug 07 2020 at 21:26)</a>:</h4>
<p>Well it's not 2200 lines, it's 9700. That should still build instantly though.</p>



<a name="206311818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206311818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206311818">(Aug 07 2020 at 21:30)</a>:</h4>
<p>so yeah, definitely issue worthy, but I recall seeing this crate in one before, so maybe there already is an issue that fits?</p>



<a name="206311826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206311826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206311826">(Aug 07 2020 at 21:30)</a>:</h4>
<p>Ah yeah, I meant the the functions for just the native platform are ~2200 locs. The rest is for the web platforms and a bunch of externs and constants. The web platforms would not be built for the mentioned timings.</p>



<a name="206311832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206311832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206311832">(Aug 07 2020 at 21:30)</a>:</h4>
<p><code>check_trait_item_well_formed</code> is the query taking most time</p>



<a name="206311941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206311941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206311941">(Aug 07 2020 at 21:31)</a>:</h4>
<p>oh, because the <code>HasContext</code> trait is <em>massive</em></p>



<a name="206312215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206312215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206312215">(Aug 07 2020 at 21:34)</a>:</h4>
<p>Is it that massive? It's like 830 lines (I keep bringing up lines, but of course that's not a perfect metric)</p>



<a name="206312388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206312388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206312388">(Aug 07 2020 at 21:36)</a>:</h4>
<p>I did a quick search for issues mentioning <code>glow</code> and didn't spot any on <a href="https://github.com/rust-lang/rust">https://github.com/rust-lang/rust</a></p>



<a name="206312675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206312675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206312675">(Aug 07 2020 at 21:40)</a>:</h4>
<p>Created a <a href="/user_uploads/4715/wbxkodTXARMPsM-r9gQ_Gztc/flamegraph.svg">flamegraph.svg</a></p>



<a name="206312691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206312691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206312691">(Aug 07 2020 at 21:40)</a>:</h4>
<p>It would presumably be part of other issues about wf checking being slow</p>



<a name="206313030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206313030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206313030">(Aug 07 2020 at 21:46)</a>:</h4>
<p>hmm.. I can't find an existing issue anywhere pertaining to <code>glow</code> and <code>wf_checking</code>.</p>



<a name="206314627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206314627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206314627">(Aug 07 2020 at 22:04)</a>:</h4>
<p>yes, please file one, this is silly</p>



<a name="206314686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206314686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206314686">(Aug 07 2020 at 22:05)</a>:</h4>
<p>wf checking one associated type requires proving <em>all</em> predicates on <em>all</em> associated types -&gt; <code>O(n²)</code></p>



<a name="206315020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206315020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206315020">(Aug 07 2020 at 22:09)</a>:</h4>
<p>That seems not good. It sounds like you have better context to describe the issue. <br>
Would you mind opening it instead and tagging me (@kettle11 on github)?</p>



<a name="206315553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206315553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206315553">(Aug 07 2020 at 22:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F/near/206314686">said</a>:</p>
<blockquote>
<p>wf checking one associated type requires proving <em>all</em> predicates on <em>all</em> associated types -&gt; <code>O(n²)</code></p>
</blockquote>
<p>This should be fixed by <a href="https://github.com/rust-lang/rust/issues/73905">#73905</a></p>



<a name="206315617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206315617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206315617">(Aug 07 2020 at 22:17)</a>:</h4>
<p>oh this actually looks like <a href="https://github.com/rust-lang/rust/issues/65510">https://github.com/rust-lang/rust/issues/65510</a></p>



<a name="206315620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206315620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206315620">(Aug 07 2020 at 22:17)</a>:</h4>
<p>nice!</p>



<a name="206317360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Slow%20compile%20times.%2014s%20in%20wf_checking%20for%20%7E6000%20loc%3F/near/206317360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ian Kettlewell <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Slow.20compile.20times.2E.2014s.20in.20wf_checking.20for.20~6000.20loc.3F.html#206317360">(Aug 07 2020 at 22:43)</a>:</h4>
<p>Thanks for the help <span class="user-mention" data-user-id="211727">@Jonas Schievink</span> and <span class="user-mention" data-user-id="116118">@Matthew Jasper</span> . It's reassuring to see there's already a known issue and a potential fix in the works.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>